package com.TP.www.dao.impl;

import com.TP.www.po.Customer;
import com.TP.www.po.Merchant;
import com.TP.www.po.User;
import com.TP.www.util.JdbcUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 邱彦祥
 */
public class UserDAO implements com.TP.www.dao.User {

    @Override
    public int executeUpdate(String sql, Object... objects){
        return JdbcUtils.executeUpdate(sql, objects);
    }


    @Override
    public List<User> executeQuery(String merchantSql, String customerSql){
       List<User> list = new ArrayList<>();
       list.addAll(JdbcUtils.executeQuery(merchantSql,new Merchant()));
       list.addAll(JdbcUtils.executeQuery(customerSql,new Customer()));
       return list;
    }
}
